Skip to content

Conversation

@weihanglo
Copy link
Member

What does this PR try to resolve?

These paths are reserved for future extension:

  • .cargo/config.toml.d -> configuration fragment support
  • .cargo/user.config.toml -> auto-include user local config
  • .cargo/user.config.toml.d -> a combination of the above

This is kinda modeled after system.conf.d:
https://www.freedesktop.org/software/systemd/man/latest/system.conf.d.html

How to test and review this PR?

Maybe this need some bikeshedding?
See also #t-cargo > Built-in `.cargo/config.local.toml`for non-committed config

These paths are reserved for future extension:

* `.cargo/config.toml.d` -> configuration fragment support
* `.cargo/user.config.toml` -> auto-include user local config
* `.cargo/user.config.toml.d` -> a combination of the above

This is kinda modeled after `system.conf.d`:
https://www.freedesktop.org/software/systemd/man/latest/system.conf.d.html
@rustbot rustbot added A-configuration Area: cargo config files and env vars S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 19, 2025

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

return Ok(None);
}

let reserved_paths = ["config.toml.d", "user.config.toml", "user.config.toml.d"];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatives for user configuration:

  • local.config.toml
  • config.local.toml
  • config.user.toml

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can decide at this point, we can reserve all of them

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be better if we reserved the whole namespace (crates/*), at least temporarily. It would move the concern of what to reserve to a later date.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned about us having to guess what we might want in the future.

Would be interested in seeing an updated stabilization report as that might provide some context to help with this (e.g. what have we said about globs/directory previously?)

return Ok(None);
}

let reserved_paths = ["config.toml.d", "user.config.toml", "user.config.toml.d"];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For configuration fragments:

  • conf.d
  • includes
  • Can't think of others

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These actually doesn't need to be reserved, and they don't have .toml extension so aren't allowed already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-configuration Area: cargo config files and env vars S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants